package com.ruoyi.point.domain;

import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import org.apache.ibatis.type.Alias;

/**
 * 用户信息管理对象 users
 * 
 * @author hy
 * @date 2025-08-12
 */
@Alias("pointUsers")
public class Users extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 用户唯一ID */
    private Integer id;

    /** 昵称 */
    @Excel(name = "昵称")
    private String nickname;

    /** 头像URL */
    @Excel(name = "头像URL")
    private String avatarUrl;

    /** 性别（0-未知，1-男，2-女） */
    @Excel(name = "性别", readConverterExp = "0=-未知，1-男，2-女")
    private Integer sex;

    /** 生日 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "生日", width = 30, dateFormat = "yyyy-MM-dd")
    private Date birthday;

    /** 加入时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "加入时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date joinTime;

    /** 手机号（登录/找回密码） */
    @Excel(name = "手机号", readConverterExp = "登=录/找回密码")
    private String phone;

    /** 密码哈希 */
    @Excel(name = "密码哈希")
    private String password;

    /** 用户地区信息 */
    @Excel(name = "用户地区信息")
    private String address;

    /** 个人简介 */
    @Excel(name = "个人简介")
    private String introduce;

    /** 加密盐 */
    private String salt;

    /** 当前总积分 */
    @Excel(name = "当前总积分")
    private Long totalPoint;

    /** 是否会员（0-否，1-是） */
    @Excel(name = "是否会员", readConverterExp = "0=-否，1-是")
    private Integer isVip;

    /** 会员过期时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "会员过期时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date vipExpireTime;

    /** 账号状态（0-正常，1-封禁） */
    @Excel(name = "账号状态", readConverterExp = "0=-正常，1-封禁")
    private Integer status;

    /** 是否删除：0正常 1删除 */
    private Integer del;

    // 多表联查字段 - 积分统计
    /** 总获得积分 */
    private Long totalEarned;

    /** 总使用积分 */
    private Long totalUsed;

    /** 本月获得积分 */
    private Long monthEarned;

    /** 本月使用积分 */
    private Long monthUsed;

    public void setId(Integer id) 
    {
        this.id = id;
    }

    public Integer getId() 
    {
        return id;
    }

    public void setNickname(String nickname) 
    {
        this.nickname = nickname;
    }

    public String getNickname() 
    {
        return nickname;
    }

    public void setAvatarUrl(String avatarUrl) 
    {
        this.avatarUrl = avatarUrl;
    }

    public String getAvatarUrl() 
    {
        return avatarUrl;
    }

    public void setSex(Integer sex) 
    {
        this.sex = sex;
    }

    public Integer getSex() 
    {
        return sex;
    }

    public void setBirthday(Date birthday) 
    {
        this.birthday = birthday;
    }

    public Date getBirthday() 
    {
        return birthday;
    }

    public void setJoinTime(Date joinTime) 
    {
        this.joinTime = joinTime;
    }

    public Date getJoinTime() 
    {
        return joinTime;
    }

    public void setPhone(String phone) 
    {
        this.phone = phone;
    }

    public String getPhone() 
    {
        return phone;
    }

    public void setPassword(String password) 
    {
        this.password = password;
    }

    public String getPassword() 
    {
        return password;
    }

    public void setAddress(String address) 
    {
        this.address = address;
    }

    public String getAddress() 
    {
        return address;
    }

    public void setIntroduce(String introduce) 
    {
        this.introduce = introduce;
    }

    public String getIntroduce() 
    {
        return introduce;
    }

    public void setSalt(String salt) 
    {
        this.salt = salt;
    }

    public String getSalt() 
    {
        return salt;
    }

    public void setTotalPoint(Long totalPoint) 
    {
        this.totalPoint = totalPoint;
    }

    public Long getTotalPoint() 
    {
        return totalPoint;
    }

    public void setIsVip(Integer isVip) 
    {
        this.isVip = isVip;
    }

    public Integer getIsVip() 
    {
        return isVip;
    }

    public void setVipExpireTime(Date vipExpireTime) 
    {
        this.vipExpireTime = vipExpireTime;
    }

    public Date getVipExpireTime() 
    {
        return vipExpireTime;
    }

    public void setStatus(Integer status) 
    {
        this.status = status;
    }

    public Integer getStatus() 
    {
        return status;
    }

    public void setDel(Integer del) 
    {
        this.del = del;
    }

    public Integer getDel() 
    {
        return del;
    }

    // 积分统计字段的getter和setter
    public Long getTotalEarned() {
        return totalEarned;
    }

    public void setTotalEarned(Long totalEarned) {
        this.totalEarned = totalEarned;
    }

    public Long getTotalUsed() {
        return totalUsed;
    }

    public void setTotalUsed(Long totalUsed) {
        this.totalUsed = totalUsed;
    }

    public Long getMonthEarned() {
        return monthEarned;
    }

    public void setMonthEarned(Long monthEarned) {
        this.monthEarned = monthEarned;
    }

    public Long getMonthUsed() {
        return monthUsed;
    }

    public void setMonthUsed(Long monthUsed) {
        this.monthUsed = monthUsed;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("nickname", getNickname())
            .append("avatarUrl", getAvatarUrl())
            .append("sex", getSex())
            .append("birthday", getBirthday())
            .append("joinTime", getJoinTime())
            .append("phone", getPhone())
            .append("password", getPassword())
            .append("address", getAddress())
            .append("introduce", getIntroduce())
            .append("salt", getSalt())
            .append("totalPoint", getTotalPoint())
            .append("isVip", getIsVip())
            .append("vipExpireTime", getVipExpireTime())
            .append("status", getStatus())
            .toString();
    }
}
